#include "Particle.h"


Particle::Particle()
{
	position[0] = 0;
	position[1] = 0;
}

Particle::Particle(double startingX, double startingY)
{
	position[0] = startingX;
	position[1] = startingY;
}

void Particle::randomMove() //Default move distance of 1, assumes 2d isotropy
{
	double angle = 2*M_PI*(((double)rand())/RAND_MAX);
	double x = cos(angle);
	double y = sin(angle);
	position[0]+= x;
	position[1]+= y;
}

void Particle::randomMove(double distance)
{
	double angle = 2*M_PI*(((double)rand())/RAND_MAX);
	double x = distance*cos(angle);
	double y = distance*sin(angle);
	position[0]+= x;
	position[1]+= y;
}

void Particle::setPosition(double X, double Y)
{
	position[0] = X;
	position[1] = Y;
}